home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1997-01-28 | 5.3 KB | 211 lines |
- 10 'LOGYAG Log-Periodic Yagi Array - 03 MAR 95 rev. 18 DEC 96
- 20 IF EX$=""THEN EX$="EXIT"
- 30 CLS:KEY OFF
- 40 COLOR 7,0,1
- 50 U1$="###.###"
- 60 U2$="##.###"
- 70 UL$=STRING$(80,205)
- 80 PI=3.14159
- 90 '
- 100 '.....start
- 110 CLS
- 120 COLOR 15,2
- 130 PRINT " LOG-YAG Log-Periodic Yagi Antenna";
- 140 PRINT TAB(57);"by George Murphy VE3ERP ";
- 150 COLOR 1,0:PRINT STRING$(80,223);
- 160 COLOR 7,0
- 170 GOSUB 1920 'standard antenna preface
- 180 PRINT UL$;
- 190 GOSUB 1680 'notes
- 200 Z$=INKEY$:IF Z$=""THEN 200
- 210 IF Z$="0"THEN CLS:RUN EX$
- 220 IF Z$="1"THEN 250
- 230 GOTO 200
- 240 '
- 250 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
- 260 PRINT " Press number in < > to choose standard units of measure:"
- 270 PRINT UL$;
- 280 PRINT " < 1 > Metric"
- 290 PRINT " < 2 > U.S.A./Imperial"
- 300 Z$=INKEY$
- 310 IF Z$="1"THEN UM=0.3048:UM$="m":GOTO 340
- 320 IF Z$="2"THEN UM=1:UM$="'":GOTO 340
- 330 GOTO 300
- 340 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
- 350 GOTO 410
- 360 '
- 370 '.....erase previous line
- 380 LOCATE CSRLIN-1:PRINT:LOCATE CSRLIN-1
- 390 RETURN
- 400 '
- 410 '.....start
- 420 LOCATE 3
- 430 INPUT " ENTER: Low edge of band (MHz)................";FL
- 440 GOSUB 370
- 450 PRINT " Low edge of band......................";USING U1$;FL;
- 460 PRINT " MHz"
- 470 INPUT " ENTER: High edge of band (MHz)...............";FH
- 480 GOSUB 370
- 490 PRINT " High edge of band.....................";USING U1$;FH;
- 500 PRINT " MHz"
- 510 B=FH/FL
- 520 PRINT " Operating bandwidth...................";USING U1$;B
- 530 BS=1.15*B
- 540 PRINT " Structure bandwidth (log cell array)..";USING U1$;BS
- 550 INPUT " ENTER: Number of driven elements.............";N
- 560 DIM DE(N,3)
- 570 GOSUB 370
- 580 PRINT " Number of driven elements.............";USING "###";N;
- 590 PRINT " "
- 600 K=1/(BS^(1/(N-1)))
- 610 PRINT " Design constant.....................==";USING U1$;K
- 620 '
- 630 Z1=0.2/(1-K) 'cotangent of apex half-angle
- 640 Z2=1/Z1 'tangent of apex half-angle
- 650 Z3=ATN(Z2) 'apex half-angle in radians
- 660 '
- 670 DEG=Z3*180/PI
- 680 PRINT " Apex half-angle.......................";USING U1$;DEG;
- 690 PRINT "<UNK! {00F8}>"
- 700 WMAX=984/FL
- 710 PRINT " Free-space wavelength.................";USING U1$;WMAX*UM;
- 720 PRINT UM$
- 730 L=(0.25*(1-1/BS)*Z1)*WMAX
- 740 PRINT " Log cell boom length..................";USING U1$;L*UM;
- 750 PRINT UM$;" ( El. 1 to El.";N;")"
- 760 '
- 770 '.....element lengths
- 780 DE(1,1)=492/FL
- 790 FOR Z=2 TO N
- 800 DE(Z,1)=K*DE(Z-1,1)
- 810 NEXT Z
- 820 '
- 830 '.....element spacing
- 840 DE(1,2)=0.5*(DE(1,1)-DE(2,1))*Z1:DE(1,3)=DE(1,2)
- 850 FOR Z=2 TO N-1
- 860 DE(Z,2)=K*DE(Z-1,2)
- 870 DE(Z,3)=DE(Z-1,3)+DE(Z,2) 'total distance from element #1
- 880 NEXT Z
- 890 '
- 900 '.....reflector
- 910 LREF=509.6/FL
- 920 DREF=84/FL
- 930 '
- 940 '.....director
- 950 LDIR=450.8/FL
- 960 DDIR=148/FL
- 970 '
- 980 BOOM=L+DREF+DDIR 'boom length
- 990 '
- 1000 '.....screen print
- 1010 PRINT " Reflector length......................";USING U1$;LREF*UM;
- 1020 PRINT UM$
- 1030 PRINT UL$;
- 1040 LN=CSRLIN-1
- 1050 FOR Z=1 TO N
- 1060 Z$=RIGHT$(STR$(Z),LEN(STR$(Z))-1)
- 1070 IF LEN(Z$)<2 THEN Z$=" "+Z$
- 1080 LN=LN+1
- 1090 PRINT " Element #";Z$;" length....................";
- 1100 PRINT USING U1$;DE(Z,1)*UM;
- 1110 PRINT UM$;" @";
- 1120 IF Z=1 THEN PRINT USING U1$;DREF*UM;:PRINT UM$;" from Reflector":GOTO 1180
- 1130 IF DE(Z-1,2)=0 THEN PRINT "":GOTO 1180
- 1140 PRINT USING U1$;DE(Z-1,3)*UM;
- 1150 PRINT UM$;" from # 1";
- 1160 IF LN<22 THEN PRINT "":GOTO 1180
- 1170 GOSUB 1980:CLS:LN=0
- 1180 NEXT Z
- 1190 '
- 1200 PRINT " Director length.......................";USING U1$;LDIR*UM;
- 1210 PRINT UM$;" @";
- 1220 PRINT USING U1$;DDIR*UM;
- 1230 PRINT "' from #";Z-1
- 1240 PRINT " Reflector-to-Director distance........";USING U1$;BOOM*UM;
- 1250 PRINT UM$;" (total boom length)"
- 1260 GOSUB 1980
- 1270 CLS
- 1280 '
- 1290 '.....diagram
- 1300 U=5 'length of 1/2 element
- 1310 PRINT " DIRECTOR";TAB(40-U-2);STRING$(U+2,196);" ";STRING$(U+2,196)
- 1320 LOCATE CSRLIN-1,36:PRINT"DEFSNG"USING U2$;LDIR;:PRINT UM$;"DEFDBL"
- 1330 PRINT TAB(40);"CALL"
- 1340 PRINT TAB(40);"CALL ";USING U2$;DDIR;:PRINT UM$
- 1350 PRINT TAB(40);"CALL"
- 1360 LN=4
- 1370 '
- 1380 FOR Z=N TO 1 STEP-1
- 1390 LN=LN+1
- 1400 U=U+1:IF U>25 THEN U=25
- 1410 PRINT " Element #";Z;TAB(40-U);STRING$(U,"SOUND");"CALL";STRING$(U,196)
- 1420 LOCATE CSRLIN-1,36:PRINT"DEFSNG"USING U2$;DE(Z,1)*UM;:PRINT UM$;"DEFDBL"
- 1430 LN=LN+1:PRINT TAB(40);"CALL ";
- 1440 X=DE(Z-1,2)*UM:IF X THEN PRINT USING U2$;DE(Z-1,2)*UM;:PRINT UM$;
- 1450 IF LN<22 THEN PRINT "":GOTO 1470
- 1460 GOSUB 1980:CLS:LN=0
- 1470 NEXT Z
- 1480 IF LN=0 THEN 1500
- 1490 LOCATE CSRLIN-1
- 1500 PRINT TAB(40);"CALL"
- 1510 PRINT TAB(40);"CALL ";USING U2$;DREF*UM;:PRINT UM$
- 1520 U=U+2
- 1530 PRINT " REFLECTOR";TAB(40-U);STRING$(U,196);" ";STRING$(U,196);
- 1540 LOCATE CSRLIN,36:PRINT"DEFSNG"USING U2$;LREF;:PRINT UM$;"DEFDBL";
- 1550 COLOR 15,1
- 1560 LOCATE 1,56:PRINT " Log-Periodic Yagi for "
- 1570 LOCATE 2,56:PRINT " "
- 1580 U$="####.###"
- 1590 IF FL<10^3 THEN U$="###.###"
- 1600 IF FL<10^2 THEN U$="##.###"
- 1610 IF FL<10 THEN U$="#.###"
- 1620 LOCATE 2,56:PRINT " ";USING U$;FL;:PRINT " - ";USING U$;FH;:PRINT " MHz"
- 1630 COLOR 7,0
- 1640 GOSUB 1980
- 1650 ERASE DE:GOTO 100 'start
- 1660 END
- 1670 '
- 1680 '.....notes
- 1690 TB=7
- 1700 PRINT TAB(TB);
- 1710 PRINT "This program does all the calculations pertaining to the article"
- 1720 PRINT TAB(TB);
- 1730 PRINT "'The Log-Yag Array' as it appears in the ARRL ANTENNA ANTHOLOGY,"
- 1740 PRINT TAB(TB);
- 1750 PRINT "publication No.36, page 49."
- 1760 PRINT
- 1770 PRINT TAB(TB);
- 1780 PRINT "While not absolutely necessary, the diagrams in this article might"
- 1790 PRINT TAB(TB);
- 1800 PRINT "be useful when designing a LOG-YAG."
- 1810 PRINT
- 1820 PRINT TAB(TB);
- 1830 PRINT "For a complete dissertation on LPDA (Log-Periodic Dipole Array)"
- 1840 PRINT TAB(TB);
- 1850 PRINT "antennas see any recent edition of the ARRL ANTENNA BOOK."
- 1860 PRINT UL$;
- 1870 COLOR 0,7:LOCATE CSRLIN,22
- 1880 PRINT " Press 1 to continue or 0 to EXIT....."
- 1890 COLOR 7,0
- 1900 RETURN
- 1910 '
- 1920 '.....preface
- 1930 OPEN"I",1,"\data\docfiles\antenna.doc"
- 1940 IF EOF(1)THEN 1960
- 1950 INPUT#1,NOTE$:PRINT " ";NOTE$:GOTO 1940
- 1960 CLOSE:RETURN
- 1970 '
- 1980 'HARDCOPY
- 1990 GOSUB 2100:LOCATE 25,2:COLOR 14,6
- 2000 PRINT " Press 1 to print screen, 2 to print screen & ";
- 2010 PRINT "advance paper, or 3 to continue.";:COLOR 7,0
- 2020 Z$=INKEY$:IF Z$="3"THEN GOSUB 2100:RETURN
- 2030 IF Z$="1"OR Z$="2"THEN GOSUB 2100:GOTO 2050
- 2040 GOTO 2020
- 2050 FOR QX=1 TO 24:FOR QY=1 TO 80
- 2060 LPRINT CHR$(SCREEN(QX,QY));
- 2070 NEXT QY:NEXT QX
- 2080 IF Z$="2"THEN LPRINT CHR$(12)
- 2090 GOTO 1990
- 2100 LOCATE 25,1:PRINT STRING$(80,32);:RETURN
-